<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/15
 * Time: 22:17
 */

namespace App\Library\form_builder\src\traits;

use App\Library\form_builder\src\components\Check;

trait CheckTrait
{
    /**
     * 复选框组件
     *
     * @param        $field
     * @param        $title
     * @param string $value
     * @return Radio
     */
    public static function checkbox($title,$field, $value = '')
    {
        return new Check($title,$field, (string)$value);
    }

    /**
     * 状态选择框
     */
    public static function Status($title,$field,$value='',$type=Check::STATUS_CHECKBOX){
        $check=new Check($title,$field, (string)$value);

        $check->type($type);
        return $check;
    }
}